package class

import (
	"github.com/gin-gonic/gin"
	"project/pkg/dao/mysql"
	"project/pkg/mildware"
	"project/pkg/router"
)

func init() {
	router.AddRouter(new(CRouter))
}

type CRouter struct {
}
type CHandler struct {
	M mysql.Mysql
}

func NewLHandler() *CHandler {
	return &CHandler{
		M: mysql.NewMysql(),
	}
}
func (CRouter) Router(e *gin.Engine) {
	handler := NewLHandler()
	class := e.Group("class")
	class.POST("/search/teacher/wx", handler.SearchClassInfoByTeacherID)
	class.POST("/update/info", handler.UpdateClassInfo)
	class.Use(mildware.JWTAuthMiddleware())
	class.GET("/search/teacher/pc", handler.SearchClassInfoByTeacherIDToGet)
	class.POST("/teacher/add", handler.TeacherAddClass)
}
